# i = 1
# while i <= 100:
#     print('我爱你!')
#     i +=1

#求解1到100的和
i = 1
sum = 1
while True:      #  i <= 100:
    i += 1
    sum = sum + i
    if i == 100:
        break
print(sum)

#求解1到100的奇数和
#方法1
i = 1
sum = 1
while i < 100:
    i += 2
    sum = sum + i
    if i == 99:
        break
print(sum)

#方法2
i = 1
sum = 0
while i <= 100:
    if i % 2 == 1:
        sum = sum + i
    i += 1
print(sum)


#求解1到100的偶数和
i = 2
sum = 2
while i <= 100:
    i += 2
    sum = sum + i
    if i == 100:
        break
print(sum)

